$('a').hover(function () {
    $(this).css('color', 'red');
    $('.ftx-05').css('color', 'royalblue');
}, function () {
    $(this).css('color', '');
    $('.d-notbs').css('color', 'royalblue');
});
// 手机号
var iphone = document.querySelector('#d-phone');
var iphonetext = document.querySelector('.d-phone-span');

iphone.onblur = function () {
    var uiphone = /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/
    if (uiphone.test(iphone.value)) {
        iphonetext.innerText = '格式正确';
    } else if (iphone.value.length == 0) {
        iphonetext.innerText = '手机号不可为空'
    } else {
        iphonetext.innerText = '格式不正确';
    }
}
// 验证码
var yzm = document.querySelector('#captcha');
var yzmtext = document.querySelector('.d-yzm-span');
yzm.onblur = function () {
    var uyzm = /^[A-Za-z0-9]{4}$/
    if (uyzm.test(yzm.value)) {
        yzmtext.innerText = '验证成功';
    } else {
        yzmtext.innerText = '请输入正确的验证码';
    }
}
// 设置密码
var pwd = document.querySelector('#pwd');
var dszmmspan = document.querySelector('.d-szmm-span')
pwd.onclick = function () {

    dszmmspan.innerText = '密码设置大写小写数字8-16位';
}
pwd.oninput = function () {
    var tt1 = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$/;
    if (tt1.test(pwd.value)) {
        dszmmspan.innerText = '格式正确';
    } else {
        dszmmspan.innerText = '格式不正确';

    }
    if (pwd.value == '') {
        dszmmspan.innerText = '密码不可为空';

    }
};
// 确认密码
var oPsw = document.getElementById('pwdRepeat');
var oPswtext = document.querySelector('.d-qrmm-span');
oPsw.onblur = function () {
    if (oPsw.value === pwd.value && oPsw.value.length != 0) {
        oPswtext.innerText = '密码正确';
    } else if (oPsw.value.length == 0) {
        oPswtext.innerText = '密码不可为空'
    } else {
        oPswtext.innerText = '密码错误';
    }
}
// 确认注册
var dint5 = document.querySelector('#d-int5');
dint5.onclick = function () {
    // localStorage.setItem('key', value)
    localStorage.setItem('手机号', iphone.value); 00
    //设置要保存的数据 key 和 value
    localStorage.setItem('密码', pwd.value);
    if (pwd.value.length > 0 && pwd.value.length > 8 && iphone.value.length > 0) {
        // 跳转
        location.href = '../page/enter.html'
    } else {
        alert('请输入正确内容');
    }
    return false;
}